package com.ccctop.crowd.api;

import com.ccctop.crowd.entity.po.*;
import com.ccctop.crowd.entity.vo.*;
import com.ccctop.crowd.util.ResultEntity;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("ccctop-crowd-mysql")
public interface MySQLRemoteService {
    @RequestMapping("/get/memberpo/by/login/acct/remote")
    ResultEntity<MemberPO> getMemberPOByLoginAcctRemote(@RequestParam("loginacct") String loginacct);

    @RequestMapping("/save/member/remote")
    public ResultEntity<String> saveMember(@RequestBody MemberPO memberPO);

    @RequestMapping("/save/project/vo/remote")
    ResultEntity<ProjectPO> saveProjectVORemote(@RequestBody ProjectVO projectVO, @RequestParam("memberId") Integer memberId);

    @RequestMapping("/get/portal/type/project/data/remote")
    public ResultEntity<List<PortalTypeVO>> getPortalTypeProjectDataRemote();

    @RequestMapping("/get/project/detail/remote/{projectId}")
    public ResultEntity<DetailProjectVO> getDetailProjectVORemote(@PathVariable("projectId") Integer projectId);

    @RequestMapping("/get/order/project/vo/remote")
    ResultEntity<OrderProjectVO> getOrderProjectVORemote(@RequestParam("projectId") Integer projectId, @RequestParam("returnId") Integer returnId);

    @RequestMapping("/get/address/vo/remote")
    ResultEntity<List<AddressVO>> getAddressVORemote(@RequestParam("memberId") Integer memberId);

    @RequestMapping("/save/address/remote")
    ResultEntity<String> saveAddressRemote(@RequestBody AddressVO addressVO);

    @RequestMapping("/save/order/remote")
    ResultEntity<String> saveOrderRemote(@RequestBody OrderVO orderVO);

    @RequestMapping("/get/member/byPhone")
    ResultEntity<MemberPO> getMemberByPhone(@RequestParam("phone") String phone);

    @RequestMapping("/get/member/byId")
    ResultEntity<MemberPO> getMemberById(@RequestParam("memberId") Integer memberId);

    @RequestMapping("/get/projects/byMemberId")
    ResultEntity<List<ProjectPO>> getProjectsByMemberId(@RequestParam Integer memberLoginVOId);

    @RequestMapping("/fund/info")
    ResultEntity<List<TFundRequest>> fundInfo(@RequestParam("userId") Integer userId);

    @RequestMapping("/fund/agree")
    ResultEntity<String> fundAgree(@RequestParam("itemId") Integer itemId);

    @RequestMapping("/fund/refuse")
    ResultEntity<String> fundRefuse(@RequestParam("itemId") Integer itemId);

    @RequestMapping("/fund/queryInvestors")
    ResultEntity<List<TInvestor>> queryInvestors(@RequestParam("projectId") Integer projectId);

    @RequestMapping("/fund/save")
    ResultEntity<String> saveRequests(@RequestBody List<TFundRequest> requests);

    @RequestMapping("/project/queryById")
    ResultEntity<ProjectPO> getProjectPoByProjectId(@RequestParam("projectId") Integer projectId);

    @RequestMapping("fund/info/insert")
    ResultEntity<TFundRequestInfo> fundInfoInsert(@RequestBody TFundRequestInfo info);

    @RequestMapping("/fund/support")
    ResultEntity<String> supportProject(@RequestBody TInvestor investor);

    @RequestMapping("/get/support/projects/byMemberId")
    ResultEntity<List<ProjectPO>> getSupportProjectsByMemberId(@RequestParam("userId") Integer userId);

    @RequestMapping("fund/info/selectByProjectId")
    ResultEntity<TFundRequestInfo> selectFundRequestInfoByProjectId(@RequestParam Integer projectId);

    @RequestMapping("fund/info/update")
    ResultEntity<String> updateFundRequestInfo(@RequestBody TFundRequestInfo info);

    @RequestMapping("fund/info/refuseIncrease")
    ResultEntity<String> refuseIncrease(@RequestParam("itemId") Integer itemId);

    @RequestMapping("fund/info/agreeIncrease")
    ResultEntity<String> agreeIncrease(@RequestParam("itemId") Integer itemId);

    @RequestMapping("fund/info/selectById")
    ResultEntity<TFundRequestInfo> selectFundRequestInfoById(@RequestParam Integer id);

    @RequestMapping("/fund/query")
    ResultEntity<TFundRequest> fundQuery(@RequestParam("itemId") Integer itemId);

    @RequestMapping("/wallet/selectByUserId")
    ResultEntity<TWallet> selectWalletByUserId(@RequestParam("userId") Integer userId);

    @RequestMapping("/wallet/insertWallet")
    ResultEntity<String> insertWallet(@RequestBody TWallet wallet);

    @GetMapping("/contract/selectOne")
    ResultEntity<TContractAddress> selectContractAddressByUserId(@RequestParam("projectId") Integer projectId);

    @RequestMapping("contract/insertOne")
    ResultEntity<String> contractAddressInsertOne(@RequestBody TContractAddress contractAddress);

    @RequestMapping("/update/projectSupportMoney/byId")
    ResultEntity<String> updateProjectSupportMoneyById(@RequestBody ProjectPO projectPO);
}
